home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / packages / big-menubar.el.z / big-menubar.el
Encoding:
Text File  |  1998-05-21  |  6.4 KB  |  209 lines

  1. ;; big-menubar.el --- an alternate menubar
  2.  
  3. ;; Copyright (C) 1994 Free Software Foundation, Inc.
  4.  
  5. ;; Author: Dror Caspi <dcaspi@qualcomm.com>
  6. ;; Modified by: jwz and allender and haydens@ll.mit.edu
  7. ;; Rewritten by: mrb in the differential programming style
  8. ;; Keywords: mouse menubar
  9.  
  10. ;; This file is part of XEmacs.
  11.  
  12. ;; XEmacs is free software; you can redistribute it and/or modify it
  13. ;; under the terms of the GNU General Public License as published by
  14. ;; the Free Software Foundation; either version 2, or (at your option)
  15. ;; any later version.
  16.  
  17. ;; XEmacs is distributed in the hope that it will be useful, but
  18. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  20. ;; General Public License for more details.
  21.  
  22. ;; You should have received a copy of the GNU General Public License
  23. ;; along with XEmacs; see the file COPYING.  If not, write to the 
  24. ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  25. ;; Boston, MA 02111-1307, USA.
  26.  
  27. ;;; Synched up with: Not in FSF.
  28.  
  29. ;;; Code:
  30.  
  31. (let* ((current-menubar (default-value 'current-menubar))
  32.        (edit-menu (assoc "Edit" current-menubar)))
  33.  
  34.   (unless (assoc "Transpose" edit-menu)    ; Idempotence
  35.     ;; Replace Macro buttons with Macro submenu
  36.     (delete-menu-item '("Edit" "Start Macro Recording"))
  37.     (delete-menu-item '("Edit" "End Macro Recording"))
  38.     (delete-menu-item '("Edit" "Execute Last Macro"))
  39.  
  40.     (nconc
  41.      edit-menu
  42.      '(("Macro"
  43.     ["Start Macro Recording"    start-kbd-macro (not defining-kbd-macro)]
  44.     ["End Macro Recording"        end-kbd-macro        defining-kbd-macro]
  45.     ["Name Last Macro..."        name-last-kbd-macro    last-kbd-macro]
  46.     ["Insert Macro in Buffer..."    insert-kbd-macro             t]
  47.     ["Execute Last Macro"        call-last-kbd-macro    last-kbd-macro]
  48.     )
  49.        ;; Add other useful Edit submenus
  50.        "---"
  51.        ("Mark"
  52.     ["Here"            set-mark-command        t]
  53.     ["Word"            mark-word            t]
  54.     ["Sentence"        mark-end-of-sentence        t]
  55.     ["Paragraph"        mark-paragraph            t]
  56.     ["Page"            mark-page            t]
  57.     ["Balanced Expression"    mark-sexp            t]
  58.     ["Lisp Function"    mark-defun            t]
  59.     ["C Function"        mark-c-function            t]
  60.     ["Whole Buffer"        mark-whole-buffer        t]
  61.     )
  62.        "---"
  63.        ("Search"
  64.     ["Forward..."        isearch-forward            t]
  65.     ["Backward..."        isearch-backward        t]
  66.     "---"
  67.     ["Regexp Forward..."    isearch-forward-regexp        t]
  68.     ["Regexp Backward..."    isearch-backward-regexp        t]
  69.     "---"
  70.     ["Words Forward..."    word-search-forward        t]
  71.     ["Words Backward..."    word-search-backward        t]
  72.     )
  73.        ("Replace"
  74.     ["Query..."        query-replace            t]
  75.     ["Regexp Query..."    query-replace-regexp        t]
  76.     "---"
  77.     ["All..."        replace-string            t]
  78.     ["Regexp All..."    replace-regexp            t]
  79.     )
  80.        "---"
  81.        ("Transpose"
  82.     ["Characters"        transpose-chars            t]
  83.     ["Words"        transpose-words            t]
  84.     ["Lines"        transpose-lines            t]
  85.     ["Sentences"        transpose-sentences        t]
  86.     ["Paragraphs"        transpose-paragraphs        t]
  87.     ["Balanced Expressions" transpose-sexps            t]
  88.     )
  89.        "---"
  90.        ("Register"
  91.     ["Copy to Register..."    copy-to-register        (mark)]
  92.     ["Paste Register..."    insert-register            t]
  93.     "---"
  94.     ["Save Point to Register"    point-to-register    t]
  95.     ["Jump to Register"        register-to-point    t]
  96.     )
  97.        ("Rectangles"
  98.     ["Kill Rectangle"        kill-rectangle            t]
  99.     ["Yank Rectangle"        yank-rectangle            t]
  100.     ["Rectangle to Register"    copy-rectangle-to-register    t]
  101.     ["Rectangle from Register"    insert-register            t]
  102.     ["Clear Rectangle"        clear-rectangle            t]
  103.     ["Open Rectangle"        open-rectangle            t]
  104.     ["Rectangle Mousing"
  105.      (setq mouse-track-rectangle-p (not mouse-track-rectangle-p))
  106.      :style toggle :selected mouse-track-rectangle-p]
  107.     )
  108.        "---"
  109.        ("Sort"
  110.     ["Lines"        sort-lines        (mark)]
  111.     ["Paragraphs"        sort-paragraphs        (mark)]
  112.     ["Pages"        sort-pages        (mark)]
  113.     ["Columns"        sort-columns        (mark)]
  114.     ["Regexp..."        sort-regexp-fields    (mark)]
  115.     )
  116.        ("Center"
  117.     ["Line"            center-line        t]
  118.     ["Paragraph"        center-paragraph    t]
  119.     ["Region"        center-region        (mark)]
  120.     )
  121.        ("Indent"
  122.     ["As Previous Line"    indent-relative        t]
  123.     ["To Column..."        indent-to-column    t]
  124.     "---"
  125.     ["Region"        indent-region        (mark)]
  126.     ["Balanced Expression"    indent-sexp        t]
  127.     ["C Expression"        indent-c-exp        t]
  128.     )
  129.        "---"
  130.        ("Narrow"
  131.     ["To Region"        narrow-to-region    (mark)]
  132.     ["To Page"        narrow-to-page        t]
  133.     "---"
  134.     ["Cancel"        widen
  135.      (not (and (= (point-min) 1) (= (point-max) (1+ (buffer-size)))))]
  136.     )))
  137.  
  138.     ;; Motion Submenu
  139.     (add-submenu
  140.      nil
  141.      '("Motion"
  142.        ["Goto Mark"            exchange-point-and-mark    (mark t)]
  143.        ["Goto Line..."            goto-line        t]
  144.        "---"
  145.        ["End of Balanced Parentheses ( )"    forward-list    t]
  146.        ["Beginning of Balanced Parentheses ( )"    backward-list    t]
  147.        ["Next Opening Parenthesis ("    down-list        t]
  148.        ["Previous Opening Parenthesis (" backward-up-list    t]
  149.        ["Next Closing Parenthesis )"    up-list            t]
  150.        "---"
  151.        ["End of Balanced Expression"    forward-sexp        t]
  152.        ["Beginning of Balanced Expression" backward-sexp    t]
  153.        "---"
  154.        ["End of Function"        end-of-defun        t]
  155.        ["Beginning of Function"        beginning-of-defun    t]
  156.        "---"
  157.        ["Next Page"            forward-page        t]
  158.        ["Previous Page"            backward-page        t]
  159.        "---"
  160.        ["End of Buffer"            end-of-buffer        t]
  161.        ["Beginning of Buffer"        beginning-of-buffer    t]
  162.        "---"
  163.        ["Save Current Position..."    point-to-register    t]
  164.        ["Goto Saved Position..."    register-to-point    t]
  165.        "---"
  166.        ["Set Marker..."            set-user-marker        t]
  167.        ["Goto Marker..."        goto-user-marker    t]
  168.        ["List Markers"            list-markers        t]
  169.        "---"
  170.        ["Set Goal Column"        set-goal-column        t]
  171.        ["Cancel Goal Column"        (set-goal-column t)    goal-column]
  172.        )
  173.      "Apps")
  174.  
  175.     ;; Replace Compile button with Compile menu
  176.     (add-submenu
  177.      '("Tools")
  178.      '("Compile"
  179.        ["Compile..."        compile            t]
  180.        ["Kill Compilation"    kill-compilation    t]
  181.        "---"
  182.        ["Next Error"        next-error        t]
  183.        ["Previous Error"    previous-error        t]
  184.        ["Goto Error"        compile-goto-error    t]
  185.        )
  186.      "Compile...")
  187.     (delete-menu-item '("Tools" "Compile..."))
  188.  
  189.     ;; Replace Spell-Check button with Spell Check menu
  190.     (add-submenu
  191.      '("Apps")
  192.      '("Spell Check"
  193.        ["Word"            ispell-word        t]
  194.        ["Complete Word"        ispell-complete-word    t]
  195.        ["Region"        ispell-region        t]
  196.        ["Whole Buffer"        ispell-buffer        t]
  197.        )
  198.      "Spell-Check Buffer")
  199.     (delete-menu-item '("Apps" "Spell-Check Buffer"))
  200.  
  201.     ;; Add Hex Edit button
  202.     (nconc
  203.      (assoc "Tools" current-menubar)
  204.      '("---"
  205.        ["Hex Edit File..." hexl-find-file t]))
  206.     ))
  207.  
  208. (provide 'big-menubar)
  209.